from google.appengine.api import mail
from google.appengine.api import users

def send_mail(sender_address, user_address, subject, body):
    mail.send_mail(sender_address, user_address, subject, body)

def send_updata_stutus_by_mail(user_address):
	domain = '@gmail.com'
        user_address = [member.user.nickname() + domain for member in user_address ]
        sender = users.get_current_user()
        sender_address = sender.nickname() + domain
        subject = "Confirm your registration"
        body = """
Thank you for creating an account! Please confirm your email address by
clicking on the link below:
web-collab.appspot.com
	"""
        for user_add in user_address:
            if mail.is_email_valid(user_add):
                send_mail(sender_address, user_add, subject, body)

